import axios from 'axios'

axios.defaults.headers = {token: sessionStorage.getItem('isc-basic-demo-token')}

export const sendSms = async function (sms) {
    let data = await axios.get(' /api/app/basic-demo-12jasx/demo/sendSms', {
        params: {
            'signName': sms.signname,
            'templateCode': sms.templatecode,
            'requestId': sms.requestid,
            'phoneNumbers': sms.phonenumber,
            'templateParam': sms.templateparams,
            'accessKeyId': sms.accessKeyId,
            'channel': sms.channel,
            'timestamp': sms.timestamp
        }
    })
    return data.data
}

export const sendMail = async function (mail) {
    let data = await axios.get(' /api/app/basic-demo-12jasx/demo/sendMail', {
        params: {
            'to': mail.to,
            'toName': mail.toName,
            'subject': mail.subject,
            'text': mail.inner,
            'annexFile': mail.annexfile
        }
    })
    return data.data
}

export const getAllProvince = async function () {
    let data = await axios.get(' /api/app/basic-demo-12jasx/demo/getAllProvince')
    return data.data
}

export const getSimpleWeatherByCityName = async function (city) {
    let data = await axios.get(' /api/app/basic-demo-12jasx/demo/getSimpleWeatherByCityName', {
        params: {
            'city': city
        }
    })
    return data.data
}
